package cn.ilovese.collect.vo.Device;

import cn.ilovese.collect.po.device.DeviceRequirement;
import cn.ilovese.collect.vo.report.HistoryReportVO;
import lombok.NoArgsConstructor;
import lombok.NonNull;

import java.util.Arrays;
import java.util.List;

@NoArgsConstructor
public class DeviceRequirementVO {
    private Integer id;

    private List<String> osList;

    private Integer minRam;

    private Integer maxRam;

    private List<String> processorArchitectureList;

    private Integer taskId;

    public List<String> getOsList() {
        return osList;
    }

    public List<String> getProcessorArchitectureList() {
        return processorArchitectureList;
    }

    public void setOsList(List<String> osList) {
        this.osList = osList;
    }

    public void setProcessorArchitectureList(List<String> processorArchitectureList) {
        this.processorArchitectureList = processorArchitectureList;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getMinRam() {
        return minRam;
    }

    public void setMinRam(Integer minRam) {
        this.minRam = minRam;
    }

    public Integer getMaxRam() {
        return maxRam;
    }

    public void setMaxRam(Integer maxRam) {
        this.maxRam = maxRam;
    }

    public Integer getTaskId() {
        return taskId;
    }

    public void setTaskId(Integer taskId) {
        this.taskId = taskId;
    }

    public DeviceRequirementVO(@NonNull DeviceRequirement deviceRequirement){
        this.id=deviceRequirement.getId();
        this.maxRam=deviceRequirement.getMaxRam();
        this.minRam=deviceRequirement.getMinRam();
        this.osList= Arrays.asList(deviceRequirement.getOsList().split(","));
        this.taskId=deviceRequirement.getTaskId();
        this.processorArchitectureList=Arrays.asList(deviceRequirement.getProcessorArchitectureList().split(","));;
    }
}
